Skip to content

🌟 [Major]: Reusable workflows now use GitHub App orchestration and explicit publish credentials - #408

Merged
Marius Storhaug (MariusStorhaug) merged 24 commits into
mainfrom
github-app-planning
Aug 9, 2026
Merged

🌟 [Major]: Reusable workflows now use GitHub App orchestration and explicit publish credentials#408
Marius Storhaug (MariusStorhaug) merged 24 commits into
mainfrom
github-app-planning

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jul 23, 2026

Copy link
Copy Markdown
Member

Process-PSModule now performs repository inspection, versioning, release management, and pull-request feedback through a configured GitHub App. Publishing uses the explicit PSGALLERY_API_KEY credential consistently from the reusable workflow through the publishing action.

Breaking Changes

Caller workflows must now pass GitHub App credentials and the PowerShell Gallery credential through the reusable workflow contract. Workflows that omit these required secrets fail before their dependent stages run.

secrets:
  PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
  GitHubAppClientId: ${{ secrets.GITHUB_APP_CLIENT_ID }}
  GitHubAppPrivateKey: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}

The caller can retain any local GitHub App secret names; only the reusable-workflow boundary names are fixed. PSGALLERY_API_KEY is also the input name of the publishing action.

Changed: Scoped GitHub automation

Every GitHub-dependent stage now mints a short-lived token for the triggering repository and requests only the access it needs. Version planning reads repository and pull-request data, builds read repository metadata, and publishing creates releases, uploads assets, cleans prereleases, and posts pull-request comments through the configured App.

The GitHub App installation needs Contents: write and Pull requests: write. Metadata: read is granted automatically. Permissions such as Actions, Statuses, Pages, and ID tokens remain part of the caller workflow's default github.token path and are not App permissions.

Technical Details

  • Plan, Build-Module, and Publish-Module mint repository-scoped installation tokens with pinned actions/create-github-app-token.
  • GitHub-facing actions receive the token only through step-scoped GH_TOKEN; the GitHub App path has no github.token fallback.
  • The release path, version resolution, repository metadata reads, settings, comments, and prerelease cleanup all use the App token.
  • The reusable workflow, publishing action input, action environment variable, and Process-PSModule documentation use PSGALLERY_API_KEY.
  • Canonical caller templates and Process-PSModule documentation include the App credential contract, PowerShell Gallery credential, permission matrix, and Dependabot configuration requirement.
  • The GitHub-Script named-token-input hardening follow-up remains tracked separately.
Related issues

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prefer caller-provided GH_TOKEN/GITHUB_TOKEN for GitHub API/CLI calls while keeping github.token fallback for compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove github.token fallbacks from GitHub-facing composite actions so reusable workflow paths require explicit app-token env wiring.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title Migrate Process-PSModule GitHub operations to GitHub App token auth [Breaking] Migrate Process-PSModule GitHub operations to strict GitHub App token auth Jul 23, 2026
For GitHub App-enabled workflow/action paths, remove dual-token env usage and keep explicit GH_TOKEN-only wiring with no github.token fallback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mint an installation token in Build-Module.yml (same pinned
actions/create-github-app-token@fee1f7d... as Plan and Publish-Module)
and inject it as GH_TOKEN on the Build-PSModule step.

This covers the three gh repo view calls in Build-PSModuleManifest.ps1
that read repo description, topics, and URL — all of which go through
the gh CLI and therefore consume GH_TOKEN.

The job-level GH_TOKEN: github.token fallback is removed.
workflow.yml is updated to pass the GitHubAppClientId and
GitHubAppPrivateKey secrets into the Build-Module reusable workflow.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Each token-minting step now requests only the permissions the job
actually exercises and restricts the token to the current repository.

Plan:
  repositories: current repo
  permission-contents: read   (gh release list in Resolve-Version)
  permission-pull-requests: write (label/comment via Get-PSModuleSettings)

Publish-Module:
  repositories: current repo
  permission-contents: write  (gh release create/upload/delete)
  permission-pull-requests: write (gh pr comment)

Build-Module:
  repositories: current repo
  (no permission-* needed - only gh repo view which uses metadata:read,
   auto-granted to all GitHub App installations)

This limits blast radius: even if a compromised step obtained GH_TOKEN,
it could only act on the one repository and only with the declared
permission level, not on every repo in the installation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Map Shelly's repository secrets into the generic GitHub App reusable-workflow contract in the test callers and documented example.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
## Summary
- port the durable GitHub App authentication guidance into the
Process-PSModule canonical docs tree
- document the required `GitHubAppClientId` / `GitHubAppPrivateKey`
reusable-workflow boundary and caller mapping
- document the Plan, Build-Module, and Publish-Module repository scope,
minimum permissions, and step-scoped `GH_TOKEN` injection implemented by
#408

## Stack
- Stacked on #408 (`github-app-planning`)

## Validation
- `git diff --check`

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
CSS Pass ✅
CSS_PRETTIER Pass ✅
GITHUB_ACTIONS Pass ✅
GITHUB_ACTIONS_ZIZMOR Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
HTML Pass ✅
JAVASCRIPT_ES Pass ✅
JAVASCRIPT_PRETTIER Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Route the release action through Shelly's scoped installation token and update every canonical workflow example for the required GitHub App secrets. Document the separate Dependabot secret requirement.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Distinguish the GitHub App installation permissions from caller github.token permissions and document the Dependabot private-key trust boundary.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document the required Dependabot secret mappings and their pre-review trust boundary.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title [Breaking] Migrate Process-PSModule GitHub operations to strict GitHub App token auth 🌟 [Major]: Reusable workflows now orchestrate GitHub operations through an App Aug 9, 2026
Replace the ambiguous APIKey workflow secret with PSGALLERY_API_KEY across the reusable workflow contract, test callers, and documentation. Keep the Publish-PSModule action input unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🌟 [Major]: Reusable workflows now orchestrate GitHub operations through an App 🌟 [Major]: Reusable workflows now use GitHub App orchestration and explicit publish credentials Aug 9, 2026
Upgrade create-github-app-token to pinned v3 and use its client-id input, matching the reusable workflow credential contract.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Nest the Markdown line-length setting under MD013 so Super-Linter applies the repository limit to generated help files.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Make PSGALLERY_API_KEY explicit across Process-PSModule documentation while retaining the Publish-PSModule action input name as APIKey.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Rename the Publish-PSModule action input and environment variable to PSGALLERY_API_KEY while retaining the PowerShell cmdlet parameter name.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Identify the pinned actions/create-github-app-token release as v3.2.0 in workflow and documentation references.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document the latest-release SHA pinning pattern without hard-coding a release in the authentication guide.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep GitHub App and publishing credential guidance in the canonical documentation tree instead of the repository root README.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MariusStorhaug
Marius Storhaug (MariusStorhaug) marked this pull request as ready for review August 9, 2026 13:58
@MariusStorhaug
Marius Storhaug (MariusStorhaug) merged commit 68a2a7f into main Aug 9, 2026
79 checks passed
@MariusStorhaug
Marius Storhaug (MariusStorhaug) deleted the github-app-planning branch August 9, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

1 participant